package me.zk.practice1.hw;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author zhangkai
 * @date 2023/8/9 15:11
 */
public class HWBJ54 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] nums = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();

        int k = Integer.parseInt(scanner.nextLine());

        int target = Integer.parseInt(scanner.nextLine());

        Arrays.sort(nums);

        if (k > nums.length) {
            System.out.println(0);
        }
        int l = 0;
        int r = 0;
        int sum = 0;
        int count = 0;
        while (r < nums.length) {
            if (r-l == k) {
                sum-= nums[l];
                l++;
            }

            while (r-l < k) {
                sum+=nums[l];
                r++;
            }
            if (sum > target) {
                break;
            } else if (sum == target) {
                count++;
            }

        }





    }
}
